<?php

class Factory {

    /**
     * @param $name
     * @return \Views\Base
     */
    public static function getView($name) {
        $view = NS . 'Views' . NS . ucfirst($name);
        return new $view();
    }

    /**
     * @param $class
     * @param DOMDocument $document
     * @return \Views\Widgets\Base
     */
    public static function getWidget($class, DOMDocument $document) {
        $class = NS . 'Views' . NS . 'Widgets' . NS . $class;
        return new $class($document);
    }
}
